package com.qf.day10;

import java.util.Objects;

public class Hero {
    private String name;
    private int hp;
    private int ad;

    public Hero() {
    }

    public Hero(String name, int hp, int ad) {
        this.name = name;
        this.hp = hp;
        this.ad = ad;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getAd() {
        return ad;
    }

    public void setAd(int ad) {
        this.ad = ad;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", hp=" + hp +
                ", ad=" + ad +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Hero hero = (Hero) o;
        return hp == hero.hp && ad == hero.ad && Objects.equals(name, hero.name);
    }


}
